// Below is the translation of the provided C code into Rust, maintaining the core functionality. The translation aims to closely mirror the design of the original code while adapting it to idiomatic Rust patterns, such as ownership and memory safety.
// 
// ### Translation to Rust
// 
// In Rust, we'll define a `DoublyLinkedList` that implements the desired behavior. The `Option` type with `Box` allows us to safely work with nullable pointers while ensuring memory safety.
// 
// ---
// 
// #### Rust Code
// 
// 
fn main() {
    let mut list = DoublyLinkedList::new();

    list.append(Box::new(10)); // Append an integer
    list.append(Box::new(String::from("hello"))); // Append a string
    list.prepend(Box::new(42)); // Prepend an integer

    println!("List Length: {}", list.len());

    // Iterate over the list
    for value in list.iter() {
        println!("{:?}", value);
    }

    // Remove items from the front and back
    list.pop_front();
    list.pop_back();

    println!("List Length after popping: {}", list.len());
}
// 
// 
// ---
// 
// ### Translation Notes
// - The Rust version adapts the original API while leveraging Rust's safety features.
// - Direct mappings (e.g., `list_remove_entry`) are not explicitly included here but can be added similarly using the iterator logic.
// - Sorting functionality (`list_sort`) can be derived using the `Vec` abstraction and Rust's built-in sorting.
// 
// Would you like to include the sorting or more utility functions in this implementation?